<div class="row">
	<div class="col-lg-6">

		<div class="form-group">
			<label for="inputAgenceName">Libell&#233; de l'agence</label>
		    <input id="inputAgenceName" name="agenceLibelle" ng-model="agence.libelle" type="text" placeholder="Entrez le nom de l'agence" class="form-control" required ng-class="{ 'input-block' : submitted }">

		    <p ng-show="formAgence.agenceLibelle.$invalid && submitted == true" class="help-block">Le nom de l'agence est requis.</p>
		</div>

	</div>
	<div class="col-lg-6">
		<div class="form-group">
			<label for="inputAgenceAdresse">Adresse</label>
		    
		    <textarea id="inputAgenceAdresse" name="agenceAdresse" ng-model="agence.adresse" type="text" placeholder="Entrez l'adresse compl&#232;te" class="form-control" required ng-class="{ 'input-block' : submitted }" rows="2"></textarea>

		    <p ng-show="formAgence.agenceAdresse.$error.required && submitted" class="help-block">Vous devez saisir une adresse postale.</p>

		</div>
	</div>
</div>

<div class="row">
	<div class="col-lg-6">
		<div class="form-group">
			<label for="inputAgenceEmail">Email</label>
		    <input id="inputAgenceEmail" name="agenceMail" ng-model="agence.mail" type="email" placeholder="Votre email de contact" class="form-control" required ng-class="{ 'input-block' : submitted }">
		    
		    <p ng-show="formAgence.agenceMail.$error.required && submitted" class="help-block">Votre adresse mail est requise.</p>
		    <p ng-show="formAgence.agenceMail.$error.email && submitted" class="help-block">Votre adresse mail n'est pas valide.</p>
		</div>
	</div>

	<div class="col-lg-6">
		<div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputAgenceCodePostal">Code postal</label><!-- my-code-postal-validator -->
				    <input id="inputAgenceCodePostal" name="agenceCodePostal" ng-model="agence.codePostal" type="text" placeholder="Code postal de la ville" class="form-control" required ng-class="{ 'input-block' : submitted }">

				    <p ng-show="formAgence.agenceCodePostal.$error.required && submitted" class="help-block">Veuillez saisir un code postal.</p>
				    <p ng-show="formAgence.agenceCodePostal.$error.codepostalValidate && submitted" class="help-block">Veuillez saisir un code postal valid (type: 12345).</p>

				</div>
			</div>
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputAgenceVille">Ville</label>
				    <input id="inputAgenceVille" name="agenceVille" ng-model="agence.ville" type="text" placeholder="Entrez le nom de la ville" class="form-control" required ng-class="{ 'input-block' : submitted }">

				    <p ng-show="formAgence.agenceVille.$error.required && submitted" class="help-block">Veuillez saisir une ville.</p>

				</div>
			</div>
		</div>
	</div>

</div>

<div class="row">
	<div class="col-lg-6">

		<div class="row">
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputAgenceTelephone">T&#233;l&#233;phone</label>
				    <input id="inputAgenceTelephone" name="agencePhone" ng-model="agence.phone" type="text" placeholder="Entrez un num&#233;ro de t&#233;l&#233;phone" class="form-control" required ng-class="{ 'input-block' : submitted }">

			    	<p ng-show="formAgence.agencePhone.$error.required && submitted" class="help-block">Le numéro de téléphone est requis.</p>

				</div>
			</div>
			<div class="col-lg-6">
				<div class="form-group">
					<label for="inputAgenceFax">Fax</label>
				    <input id="inputAgenceFax" ng-model="agence.fax" type="text" placeholder="Entrez un num&#233;ro de fax" class="form-control">
				</div>
			</div>
		</div>

	</div>

	<div class="col-lg-3">
		<div class="form-group">
			<label for="inputAgenceVille">Pays</label>
		    <input id="inputAgenceVille" name="agenceVille" ng-model="agence.pays" type="text" placeholder="Entrez le nom du pays" class="form-control" required ng-class="{ 'input-block' : submitted }" ng-init="agence.pays='FRANCE'">

		    <p ng-show="formAgence.agenceVille.$error.required && submitted" class="help-block">Veuillez saisir un pays.</p>
		</div>
	</div>

</div>

<div class="row">
	
	<div class="col-lg-4">
		<div class="form-group">
			<label for="sejourImage">Logo de l'agence</label>
		    <div class="controls">
		        <span class="btn btn-success fileinput-button">
		            <i class="fa  fa-plus-circle"></i>
		            <input type="file" name="file" data-url="uploadLogoAgence" upload>
		            <span>Parcourir...</span>
		        </span>
		        <input type="hidden" ng-model="agence.imageUrl" />
		    </div>
		</div>
	</div>
	<div class="col-lg-6">
		<div class="form-group">
			<label>&nbsp;</label>

			<div ng-show="!files.length && agence.imageUrl">

				<agencelogo th-id="{{agence.id}}" th-nom="{{agence.imageUrl}}" th-libelle="{{agence.libelle}}"/>

			</div>

			<div>
				<span ng-show="files.length && !percentage">{{ files[0].name | truncate:20 }}   <em>({{ files[0].size | sizeConverterFilter:1 }})</em></span>
				<span ng-show="files.length && percentage">En cours de téléchargement</span>

				<div class="progress" ng-show="percentage">
				    <div class="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: {{percentage}}%;">
				    	<span>{{percentage}}% Complete</span>
				    </div>
				</div>
				<span ng-show="!files.length && !percentage && !agence.imageUrl">
					Aucun logo
				</span>
			</div>
		</div>
	</div>
	<div class="col-lg-2">
		<div class="form-group">
			<label for="sejourImage">&nbsp;</label>
			<button ng-show="files.length || agence.imageUrl" ng-click="removeImage()" type="button" class="form-control btn btn-xs btn-default">Supprimer le logo</button>
		</div>
	</div>

</div>
